package com.rickpan.dto.response;

/**
 * 分片上传响应DTO
 */
public class ChunkUploadResponse {
    
    private boolean success;
    private String message;
    private Long uploadedSize;
    private Integer progress;
    
    // 构造函数
    public ChunkUploadResponse() {}
    
    public ChunkUploadResponse(boolean success, String message) {
        this.success = success;
        this.message = message;
    }
    
    public ChunkUploadResponse(boolean success, String message, Long uploadedSize, Integer progress) {
        this.success = success;
        this.message = message;
        this.uploadedSize = uploadedSize;
        this.progress = progress;
    }
    
    // 静态工厂方法
    public static ChunkUploadResponse success(String message) {
        return new ChunkUploadResponse(true, message);
    }
    
    public static ChunkUploadResponse success(String message, Long uploadedSize, Integer progress) {
        return new ChunkUploadResponse(true, message, uploadedSize, progress);
    }
    
    public static ChunkUploadResponse error(String message) {
        return new ChunkUploadResponse(false, message);
    }
    
    // Getter和Setter方法
    public boolean isSuccess() {
        return success;
    }
    
    public void setSuccess(boolean success) {
        this.success = success;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }
    
    public Long getUploadedSize() {
        return uploadedSize;
    }
    
    public void setUploadedSize(Long uploadedSize) {
        this.uploadedSize = uploadedSize;
    }
    
    public Integer getProgress() {
        return progress;
    }
    
    public void setProgress(Integer progress) {
        this.progress = progress;
    }
    
    @Override
    public String toString() {
        return "ChunkUploadResponse{" +
                "success=" + success +
                ", message='" + message + '\'' +
                ", uploadedSize=" + uploadedSize +
                ", progress=" + progress +
                '}';
    }
}
